<template>
  <div>
    <ul>
      <li> <router-link to="/One2/two1">All contacts</router-link></li>
      <li> <router-link to="/One2/two2">Alice</router-link></li>
      <li> <router-link to="/One2/two3">Bob </router-link></li>
    </ul>
    <button @click="btn">随机显示</button>
    <div style="border:1px solid blue">
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    btn(){
      let i = Math.floor(Math.random() * 3)
      let arr= ["/One2/two1","/One2/two2","/One2/two3"]
      this.$router.push(arr[i])
    }
  }
};
</script>

<style scoped>
.router-link-exact-active {
  color: orange;
}
.router-link-active{
  color: orange;
}
</style>